package com.example.project.webControlleer;

import com.example.project.dao.CarDAO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("web")
public class WebRenamesController {

    @RequestMapping("CheckRenameController")
    @ResponseBody
    public String renames(HttpServletRequest request, HttpServletResponse response)
    {
        String x=request.getParameter("x");

        CarDAO carDAO=new CarDAO();
        boolean flag=carDAO.CheckLicenseBeforeAdd(x);
        return String.valueOf(flag);
    }

}

